﻿
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Data.Objects.DataClasses;

namespace SlotDuino.DAL
{
    [MetadataType(typeof(ChampionshipMetadata))]
    public partial class Championship
    {
        internal sealed class ChampionshipMetadata
        {
        
            [Required(ErrorMessage="Id is required")]
           public Int32 Id { get; set; }

            [Required(ErrorMessage="Name is required")]
           public String Name { get; set; }

            [Required(ErrorMessage="Start Date is required")]
            [DataType(DataType.DateTime)]
           public DateTime StartDate { get; set; }

            [Required(ErrorMessage="End Date is required")]
            [DataType(DataType.DateTime)]
           public DateTime EndDate { get; set; }

            [Required(ErrorMessage="Qualifying Time is required")]
           public TimeSpan QualifyingTime { get; set; }

            [Required(ErrorMessage="Race Time is required")]
           public TimeSpan RaceTime { get; set; }

            [Required(ErrorMessage="Interval Time is required")]
           public TimeSpan IntervalTime { get; set; }

            [Required(ErrorMessage="State is required")]
           public Byte State { get; set; }

           public EntityCollection<ChampionshipEnrollment> Enrollments { get; set; }

           public EntityCollection<ChampionshipHeat> Heats { get; set; }

        }
    }
    
    [MetadataType(typeof(ChampionshipEnrollmentMetadata))]
    public partial class ChampionshipEnrollment
    {
        internal sealed class ChampionshipEnrollmentMetadata
        {
        
            [Required(ErrorMessage="Id is required")]
           public Int32 Id { get; set; }

            [Required(ErrorMessage="Pilot is required")]
           public Int32 PilotId { get; set; }

            [Required(ErrorMessage="Championship is required")]
           public Int32 ChampionshipId { get; set; }

            [Required(ErrorMessage="Qualify Time is required")]
           public TimeSpan QualifyTime { get; set; }

           public EntityCollection<Pilot> Pilot { get; set; }

           public EntityCollection<Championship> Championship { get; set; }

        }
    }
    
    [MetadataType(typeof(ChampionshipHeatMetadata))]
    public partial class ChampionshipHeat
    {
        internal sealed class ChampionshipHeatMetadata
        {
        
            [Required(ErrorMessage="Id is required")]
           public Int32 Id { get; set; }

            [Required(ErrorMessage="Championship is required")]
           public Int32 ChampionshipId { get; set; }

            [Required(ErrorMessage="Order is required")]
           public Byte Order { get; set; }

            [Required(ErrorMessage="Type is required")]
           public String Type { get; set; }

           public EntityCollection<Championship> Championship { get; set; }

           public EntityCollection<ChampionshipRace> Races { get; set; }

        }
    }
    
    [MetadataType(typeof(ChampionshipRaceMetadata))]
    public partial class ChampionshipRace
    {
        internal sealed class ChampionshipRaceMetadata
        {
        
            [Required(ErrorMessage="Championship Heat is required")]
           public Int32 ChampionshipHeatId { get; set; }

            [Required(ErrorMessage="Order is required")]
           public Byte Order { get; set; }

           public EntityCollection<ChampionshipHeat> Heat { get; set; }

        }
    }
    
    [MetadataType(typeof(ChampionshipTemplateMetadata))]
    public partial class ChampionshipTemplate
    {
        internal sealed class ChampionshipTemplateMetadata
        {
        
            [Required(ErrorMessage="Id is required")]
           public Int32 Id { get; set; }

            [Required(ErrorMessage="Name is required")]
           public String Name { get; set; }

            [Required(ErrorMessage="Qualifying Time is required")]
           public TimeSpan QualifyingTime { get; set; }

            [Required(ErrorMessage="Race Time is required")]
           public TimeSpan RaceTime { get; set; }

            [Required(ErrorMessage="Interval Time is required")]
           public TimeSpan IntervalTime { get; set; }

        }
    }
    
    [MetadataType(typeof(CompanyMetadata))]
    public partial class Company
    {
        internal sealed class CompanyMetadata
        {
        
            [Required(ErrorMessage="Id is required")]
           public Int32 Id { get; set; }

            [Required(ErrorMessage="Name is required")]
            [StringLength(250)]
           public String Name { get; set; }

           public String Address { get; set; }

            [StringLength(50)]
           public String City { get; set; }

            [StringLength(50)]
           public String State { get; set; }

           public String Country { get; set; }

            [StringLength(25)]
           public String PostalCode { get; set; }

            [StringLength(50)]
            [DataType(DataType.PhoneNumber)]
           public String Phone { get; set; }

            [StringLength(250)]
            [DataType(DataType.EmailAddress)]
           public String Email { get; set; }

            [StringLength(250)]
           public String HomePage { get; set; }

           public String Logo { get; set; }

        }
    }
    
    [MetadataType(typeof(FreeRaceMetadata))]
    public partial class FreeRace
    {
        internal sealed class FreeRaceMetadata
        {
                }
    }
    
    [MetadataType(typeof(LapMetadata))]
    public partial class Lap
    {
        internal sealed class LapMetadata
        {
        
            [Required(ErrorMessage="Number is required")]
           public Int32 Number { get; set; }

            [Required(ErrorMessage="Race Slot is required")]
           public Int32 RaceSlotId { get; set; }

            [Required(ErrorMessage="Time is required")]
           public DateTimeOffset Time { get; set; }

           public EntityCollection<RaceSlot> RaceSlot { get; set; }

        }
    }
    
    [MetadataType(typeof(OperatorMetadata))]
    public partial class Operator
    {
        internal sealed class OperatorMetadata
        {
        
            [Required(ErrorMessage="Login is required")]
            [StringLength(32)]
           public String Login { get; set; }

            [Required(ErrorMessage="Password is required")]
            [StringLength(40)]
           public String Password { get; set; }

            [Required(ErrorMessage="Is Administrator is required")]
           public Boolean IsAdministrator { get; set; }

           public EntityCollection<Race> Races { get; set; }

        }
    }
    
    [MetadataType(typeof(PersonMetadata))]
    public abstract partial class Person
    {
        internal sealed class PersonMetadata
        {
        
            [Required(ErrorMessage="Id is required")]
           public Int32 Id { get; set; }

            [Required(ErrorMessage="Name is required")]
            [StringLength(250)]
           public String Name { get; set; }

            [StringLength(250)]
            [DataType(DataType.EmailAddress)]
           public String Email { get; set; }

            [DataType(DataType.DateTime)]
           public DateTime Birthday { get; set; }

            [StringLength(50)]
            [DataType(DataType.PhoneNumber)]
           public String Phone { get; set; }

        }
    }
    
    [MetadataType(typeof(PilotMetadata))]
    public partial class Pilot
    {
        internal sealed class PilotMetadata
        {
        
            [StringLength(25)]
           public String Nickname { get; set; }

           public EntityCollection<RaceSlot> RacesSlots { get; set; }

           public EntityCollection<ChampionshipEnrollment> ChampionshipEnrollments { get; set; }

        }
    }
    
    [MetadataType(typeof(RaceMetadata))]
    public abstract partial class Race
    {
        internal sealed class RaceMetadata
        {
        
            [Required(ErrorMessage="Id is required")]
           public Int32 Id { get; set; }

            [Required(ErrorMessage="Operator is required")]
           public Int32 OperatorId { get; set; }

            [DataType(DataType.DateTime)]
           public DateTime Start { get; set; }

            [DataType(DataType.DateTime)]
           public DateTime Finish { get; set; }

            [Required(ErrorMessage="State is required")]
           public Byte State { get; set; }

            [Required(ErrorMessage="Duration is required")]
           public TimeSpan Duration { get; set; }

            [Required(ErrorMessage="Track is required")]
           public Int32 TrackId { get; set; }

           public EntityCollection<Operator> Operator { get; set; }

           public EntityCollection<RaceSlot> Slots { get; set; }

           public EntityCollection<Track> Track { get; set; }

        }
    }
    
    [MetadataType(typeof(RaceSlotMetadata))]
    public partial class RaceSlot
    {
        internal sealed class RaceSlotMetadata
        {
        
            [Required(ErrorMessage="Id is required")]
           public Int32 Id { get; set; }

            [Required(ErrorMessage="Pilot is required")]
           public Int32 PilotId { get; set; }

            [Required(ErrorMessage="Race is required")]
           public Int32 RaceId { get; set; }

            [Required(ErrorMessage="Slot is required")]
           public Byte SlotId { get; set; }

            [Required(ErrorMessage="Slot Track is required")]
           public Int32 SlotTrackId { get; set; }

            [Required(ErrorMessage="Voltage is required")]
           public Byte Voltage { get; set; }

           public EntityCollection<Pilot> Pilot { get; set; }

           public EntityCollection<Race> Race { get; set; }

           public EntityCollection<Lap> Laps { get; set; }

           public EntityCollection<Slot> Slot { get; set; }

        }
    }
    
    [MetadataType(typeof(SlotMetadata))]
    public partial class Slot
    {
        internal sealed class SlotMetadata
        {
        
            [Required(ErrorMessage="Id is required")]
           public Byte Id { get; set; }

            [Required(ErrorMessage="Track is required")]
           public Int32 TrackId { get; set; }

            [Required(ErrorMessage="Color is required")]
           public String Color { get; set; }

           public EntityCollection<Track> Track { get; set; }

           public EntityCollection<RaceSlot> RaceSlots { get; set; }

        }
    }
    
    [MetadataType(typeof(TrackMetadata))]
    public partial class Track
    {
        internal sealed class TrackMetadata
        {
        
            [Required(ErrorMessage="Id is required")]
           public Int32 Id { get; set; }

            [Required(ErrorMessage="Name is required")]
            [StringLength(150)]
           public String Name { get; set; }

            [Required(ErrorMessage="Length is required")]
           public Double Length { get; set; }

            [Required(ErrorMessage="M A C is required")]
            [StringLength(17)]
           public String MAC { get; set; }

            [Required(ErrorMessage="Min Lap Time is required")]
           public TimeSpan MinLapTime { get; set; }

            [Required(ErrorMessage="Max Lap Time is required")]
           public TimeSpan MaxLapTime { get; set; }

            [Required(ErrorMessage="Has Voltage Control is required")]
           public Boolean HasVoltageControl { get; set; }

           public EntityCollection<Slot> Slots { get; set; }

           public EntityCollection<Voltage> Voltages { get; set; }

           public EntityCollection<Race> Races { get; set; }

        }
    }
    
    [MetadataType(typeof(VoltageMetadata))]
    public partial class Voltage
    {
        internal sealed class VoltageMetadata
        {
        
            [Required(ErrorMessage="Id is required")]
           public Byte Id { get; set; }

            [Required(ErrorMessage="Track is required")]
           public Int32 TrackId { get; set; }

            [Required(ErrorMessage="Label is required")]
           public String Label { get; set; }

            [Required(ErrorMessage="Default is required")]
           public Boolean Default { get; set; }

           public EntityCollection<Track> Track { get; set; }

        }
    }
    
    
}

